<template>
    <div>
        <div v-for="item in ResumeList" :key="item.resumeId" class="Resume-item" @click="gotoResumeInfo(item.resumeId)">
            <div class="name">{{ item.seekersName }}</div>
            <div class="educationlevel">{{ item.education }}</div>
            <div class="jobposition">{{ item.recruitName }}</div>
            <div class="tip">点击后看详细信息</div>
        </div>
        <div class="page">
            <el-pagination layout="prev, pager, next" :total="700" :current-page="currentPage"
                @current-change="handlePageChange">
            </el-pagination>
        </div>
    </div>
</template>
<script>
import axios from 'D:\\job_management\\src\\axiosConfig.js'
export default {

    data() {
        return {
            ResumeList: [
                {
                    resumeId: 1,
                    seekersName: '李白',
                    education: '本科',
                    recruitName: 'Java开发',
                },
                {
                    resumeId: 2,
                    seekersName: '韩梅梅',
                    education: '本科',
                    recruitName: '前端开发',
                },
                {
                    resumeId: 3,
                    seekersName: '小明',
                    education: '本科',
                    recruitName: '嵌入式开发',
                },
                {
                    resumeId: 4,
                    seekersName: '刘薇薇',
                    education: '本科',
                    recruitName: '前端开发',
                }
            ],
            pageSize: 4,
            pageNum: 1,
            currentPage: 1,

        }
    },
    mounted() {
        axios.post('/company/resumelist',

            {
                account: this.$store.state.companyAccount,
                pageSize: this.pageSize,
                pageNum: this.pageNum
            }


        ).then(res => {
            this.ResumeList = res.data.data.company_ResumeListInfo

        }).catch(err => {
            console.log(err);
        })
    },
    methods: {
        gotoResumeInfo(resumeId) {
            this.$store.commit('changeResumeId', resumeId);
            this.$router.push('/ResumeInfo');
        },
        handlePageChange(currentPage) {
            this.pageNum = currentPage;

            axios.post('/company/resumelist',
                {
                    account: this.$store.state.account,
                    pageSize: this.pageSize,
                    pageNum: this.pageNum
                }

            )
                .then(res => {

                    this.ResumeList = res.data.data.company_ResumeListInfo
                })
                .catch(error => {
                    console.log(error);
                })
        }
    }
}


</script>
<style scoped>
.Resume-item {
    position: relative;
    width: 75%;
    height: 200px;
    background-color: #fff;
    margin-top: 20px;
    margin-left: 200px;
    border-radius: 30px;
    cursor: pointer;
    transition: box-shadow 0.5s ease-in-out;
}

.name {
    position: absolute;
    left: 40px;
    font-weight: 600;
    font-size: 22px;
    transition: color, 0.2s ease-in-out;
}

.educationlevel {
    position: absolute;
    top: 100px;
    left: 50px;
    font-weight: 400;
    font-size: 20px;
}

.jobposition {
    position: absolute;
    top: 100px;
    left: 200px;
    font-weight: 400;
    font-size: 20px;
}

.tip {
    position: absolute;
    top: 75px;
    right: 100px;
    font-weight: 400;
    font-size: 20px;
}
</style>